
Ext.Loader.setConfig({enabled: true});

Ext.Loader.setPath('Ext.ux', 'extjs/examples/ux/');

Ext.require([
    'Ext.grid.*',
    'Ext.data.*',
    'Ext.util.*',
    'Ext.tip.QuickTipManager',
    'Ext.ux.LiveSearchGridPanel'
]);

Ext.define('EM.view.event.EventPeopleView', {
    extend: 'Ext.panel.Panel',
    alias: 'widget.eventpeopleview',
    title: 'People',
    preventHeader: true,
    width: '500',
    height: '600',
    layout: 'card',
    activeItem: 0,
    autoShow: true,
    bbar: [
        {
            id: 'addpeopleviewbutton',
            iconCls: 'icon-add',
            tooltip:'Add people',
            text: 'Add People'
        }, '-',
        {
            id: 'removebutton',
            text:'Remove People',
            tooltip:'Remove the selected people',
            iconCls:'remove',
            disabled: 'true'
        }, '-',
        {
            id: 'sendemailbutton',
            text: 'Send Email',
            tooltip:'Send email to the selected people',
            iconCls:'email',
            disabled: 'true'
        }
    ],
    initComponent: function() {
        Ext.apply(this, {
            items: [
                {
                    xtype: 'allpeopleview',
                    id: 'peoplealllist',
                    title: 'All People List'
                },
                {
                    xtype: 'specificview',
                    id: 'peoplespecificlist'
                }
            ]
        });
        this.callParent(arguments);
    },
    updateActiveEvent: function(button) {
        Ext.getCmp('peoplespecificlist').updateActiveEvent(button);
        Ext.getCmp('peoplealllist').updateActiveEvent(button);
    },
    updateStore: function(store) {
        if (store == 'All') Ext.getCmp('peoplealllist').updateStore('All');
        else Ext.getCmp('peoplespecificlist').updateStore(store);
    }
});